﻿using Microsoft.Extensions.Configuration;
using SqlSugar;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

namespace Tools.Data
{
    public static class ConfigurationManager
    {
        private static IConfiguration _configuration;        

        public static void Init(this IConfiguration configuration)
        {
            _configuration = configuration;
        }        
        public static string ConnectionStrings(string connectionName)
        {
            return _configuration.GetConnectionString(connectionName);
        }

        public static string AppSettings(string key)
        {
            return _configuration.GetSection("AppSettings")[key];
        }
    }
}
